package com.meihua.shellapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.meihua.shellapp.bean.ProductTypeBean;
import com.meihua.shellapp.fragment.InsuranceTypeFragment;

import java.util.List;


public class GoodsViewPagerAdapter extends FragmentPagerAdapter{
    private List<ProductTypeBean.DataBean> mData;
    public GoodsViewPagerAdapter(FragmentManager fm, List<ProductTypeBean.DataBean> data) {
        super(fm);
        mData = data;
    }
    @Override
    public Fragment getItem(int position) {
        return InsuranceTypeFragment.newInstance(mData.get(position).getId());
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mData.get(position).getCat_name();
    }

    @Override
    public int getCount() {
        return mData.size();
    }
}
